home *** CD-ROM | disk | FTP | other *** search
/ Celestin Apprentice 2 / Apprentice-Release2.iso / Source Code / Peter Lewis / PNL Libraries / MyBusyCursors.p < prev    next >
Encoding:
Text File  |  1992-10-03  |  898 b   |  42 lines  |  [TEXT/PJMM]

  1. unit MyBusyCursors;
  2.  
  3. interface
  4.  
  5.     procedure InitBusyCursors (spin_cursor: boolean; first_cursor, last_cursor: integer);
  6.     procedure FinishBusyCursors;
  7.     procedure SpinBusyCursor;
  8.     procedure FinishBusyCursor;
  9.  
  10. implementation
  11.  
  12.     var
  13.         display_cursor: boolean;
  14.         first_idle_cursor, last_idle_cursor, idle_cursor: integer;
  15.  
  16.     procedure InitBusyCursors (spin_cursor: boolean; first_cursor, last_cursor: integer);
  17.     begin
  18.         display_cursor := spin_cursor;
  19.         first_idle_cursor := first_cursor;
  20.         idle_cursor := first_cursor;
  21.         last_idle_cursor := last_cursor;
  22.     end;
  23.  
  24.     procedure FinishBusyCursors;
  25.     begin
  26.     end;
  27.  
  28.     procedure SpinBusyCursor;
  29.     begin
  30.         if (first_idle_cursor <= idle_cursor) and (idle_cursor < last_idle_cursor) then
  31.             idle_cursor := idle_cursor + 1
  32.         else
  33.             idle_cursor := first_idle_cursor;
  34.         SetCursor(GetCursor(idle_cursor)^^);
  35.     end;
  36.  
  37.     procedure FinishBusyCursor;
  38.     begin
  39.         InitCursor;
  40.     end;
  41.  
  42. end.